package day1;

/**
 * @author oldliu
 * @since 1.0
 */
public class StrTest {
    //String不变类
    public static void main(String[] args) {
        String s1="abc";
        String s2="abc";
        System.out.println(s1==s2);
        String s5="ab";
        s5+="c";
        System.out.println(s1==s5);//false or true？
        String s3=s2;
        s2="1355554";//改了，产生一个新的String对象
        System.out.println("s3="+s3);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>");
        //byte[]b={65,66,67,97,98};
        String s7=new String(new byte[]{65,66,67,97,98});
        System.out.println(s7);
        String s8=new String(new char[]{21016,21015,99});
        System.out.println(s8);
    }
}
